<?PHP
include_once "ini.php";

$id_user = $_POST['id_user'];
dbconnect();

$position = $_POST['position'];
$dir = $_POST['dir'];
$up = $_POST['up'];
$tab = split(',', $position);

if ($position != "")
{
    $sql = "UPDATE `users` SET `latitude` = '".$tab[0]."', longitude = '".$tab[1]."', altitude = '".$tab[2]."', orientation_dir = '".$dir."', orientation_up = '".$up."' WHERE `users`.`id_users` = '".$id_user."' LIMIT 1 ;";
    $requete = mysql_query($sql);
    if (!$requete)
    {
        echo "SQL error : ", $sql;
        exit ;
    }
    else
    {
        echo "save cam position done \r\n";


    }

}
else
{
    echo "pas de position";
}

?>
